/**
 * Created by Richard Radlherr.
 * Date: 25.06.2006 17:04
 */

using System;
using System.Collections.Generic;
using CsGL;
using CsGL.OpenGL;
using TagTool.Core;
using TagTool.OpenGL;
using TagTool.GraphicTypes;

namespace TagTool.Nodes.Graphic
{
	public class VertexGenerator : BaseNode
	{
		private InputSlot x;
		private InputSlot y;
		private InputSlot z;

		private OutputSlot point;
		
		public VertexGenerator() : base()
		{
			Name = "Vertex";
			
			x = new InputSlot(this, "X", 0.0);
			x.ParseCallback = ParseHelper.ParseDouble;
			
			y = new InputSlot(this, "Y", 0.0);
			y.ParseCallback = ParseHelper.ParseDouble;
			
			z = new InputSlot(this, "Z", 0.0);
			z.ParseCallback = ParseHelper.ParseDouble;
			
			point= new OutputSlot(this, "Point", typeof(PointD));
			point.Value = new PointD(0.0, 0.0, 0.0);
		}
		
		public override void Update(Object sender)
		{
			point.Value = new PointD((double)x.Value, (double)y.Value, (double)z.Value);
			CastTrigger();
		}
		
		[NodeAttribute(SlotType.Input, Show = true)]
		public InputSlot X
		{
			get { return x; }
		}
		
		[NodeAttribute(SlotType.Input, Show = true)]
		public InputSlot Y
		{
			get { return y; }
		}
		
		[NodeAttribute(SlotType.Input, Show = true)]
		public InputSlot Z
		{
			get { return z; }
		}
		
		[NodeAttribute(SlotType.Output, Show = true)]
		public OutputSlot Point
		{
			get { return point; }
		}

		
	}
}
